const { error } = require("../../utils/response");

const userMiddleware = async (ctx, next) => {
    if(ctx.state.user){
        await next();
    }else{
        error(ctx, '请先登录', null, 401);
    }
}

module.exports = userMiddleware;